package com.develop.data.loan.converter;

import com.develop.data.loan.option.constraint.CodedOption;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.converter.ConverterFactory;

public class CodedEnumConverterFactory<CodedEnumerable extends Enum<?> & CodedOption> implements ConverterFactory<String, CodedEnumerable> {

    @Override
    public <OptionType extends CodedEnumerable> Converter<String, OptionType> getConverter(Class<OptionType> targetType) {
        return new CodedEnumConverter<OptionType>(targetType);
    }
}
